//
// Created by Administrator on 24-8-6.
//

#ifndef HWTX_KEYMAP_H
#define HWTX_KEYMAP_H
#include <stdio.h>
#include <string.h>
#include "main.h"
#define MAX_KEY_LENGTH 50
#define MAX_LIST_SIZE 100

typedef struct {
    uint8_t key;
    char value[MAX_KEY_LENGTH];
} KeyValuePair;

KeyValuePair predefinedList[] = {
        {104, "0"},
        {48, "1"},
        {24, "2"},
        {16, "4"},
        {56, "5"},
        {90, "6"},
        {66, "7"},
        {74, "8"},
        {82, "9"},
        {160, "shutdown"},
        {98, "mode"},
        {226, "quiet"},
        {34, "kuaijin"},
        {2, "previous"},
        {194, "next"},
        {34, "kuaijin"},
        {2, "previous"},
        {224, "quit"},
        {168, "voice down"},
        {144, "voice up"},
        // 添加更多键值对
};



int predefinedListSize = sizeof(predefinedList) / sizeof(predefinedList[0]);


// 查找键值对
const char* findValueByKey(int key) {
    for (int i = 0; i < predefinedListSize; i++) {
        if (predefinedList[i].key == key) {
            return predefinedList[i].value;
        }
    }
    return NULL; // 未找到键值对
}

#endif //HWTX_KEYMAP_H
